package com.rui.shangXueTang.linked;

/**
 * @author : [锐神NO.3]
 * @version : [v1.0]
 * @className : DoublyLinkedListTest
 * @createTime : [2022/2/13 22:36]
 * @description : [描述该类的功能]
 */

public class DoublyLinkedListTest {
    public static void main(String[] args) {

        DoublyLinkedList doublyLinkedList = new DoublyLinkedList();

        BookNode bookNode1 = new BookNode(1, "红楼梦", 66.00);
        BookNode bookNode2 = new BookNode(2, "西游记", 66.00);
        BookNode bookNode3 = new BookNode(3, "水浒传", 66.00);
        BookNode bookNode4 = new BookNode(4, "三国演义", 66.00);

        doublyLinkedList.add(bookNode1);
        doublyLinkedList.add(bookNode2);
        doublyLinkedList.add(bookNode3);
        doublyLinkedList.add(bookNode4);

        boolean flag = doublyLinkedList.updateNode(new BookNode(3, "我要当牛马", 66.00));
        System.out.println(flag);

        boolean delete = doublyLinkedList.deleteNode(4);
        System.out.println(delete);

        doublyLinkedList.list();
    }
}
